#
# "@(#) $Id: TrashViewItem.py,v 1.1.1.1 2006-07-27 03:16:08 gioshe Exp $"
#
# This work is released under the GNU GPL, version 2 or later.
#
from qt import *
from Utils.human import *

def _get(a,b):
	if a==None: return b
	return a

class TrashViewItem(QListViewItem):
	def __init__(self,container,track):
		QListViewItem.__init__(self,container)
		self._track = track
		self.setDragEnabled(True)
		self.loadTrackInfo()

	def die(self):
		pass
	
	def contentsMouseDoubleClickEvent(self,event):
		pass
	
	def track(self):
		return self._track

	def trackID(self):
		return self._track.trackID

	def loadTrackInfo(self):
		self.setText(0,_get(self._track.title,""))
		self.setText(1,humanDuration(self._track.totalTime))
		self.setText(2,_get(self._track.artist,""))
		self.setText(3,_get(self._track.album,""))
		self.setText(4,_get(self._track.genre,""))

	def contextMenu(self,pos,col):
		pass
